/*
 * @Date: 2024-11-25 15:43:23
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2024-12-06 13:51:34
 * @Description: 
 */
import { defineComponent, h, readonly, watch } from "vue";
import "element-plus/es/components/input/style/css";
import "element-plus/es/components/color-picker/style/css";
import './css.scss';
import { ElInput, ElColorPicker } from "element-plus";

export default defineComponent({
  emits: ["update:modelValue"],
  setup(_, { emit, attrs }) {
    function handleUpdate(e = null) {
      emit("update:modelValue", e);
    }
    return () => {
      const props = {
        ...attrs,
        "onUpdate:modelValue": handleUpdate,
      }
      return h(ElInput, {
        ...props, class: 'hp-input-color',
        readonly: true,
        placeholder: '请选择'
      }, {
        default: () => [ props.modelValue ],
        append: () => h(ElColorPicker, props)
      })
    }
  }
})